#include <QCoreApplication>
#include <QDebug>
#include <iostream>
#include <QRegularExpression>
#include <QString>

using namespace std ;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    std::cout << " aa " << std::endl;
    QString pattern("\\b\\w+\\b"); // 匹配单词
    QRegularExpression re(pattern);
    QString str = "The quick brown fox jumps over the lazy dog.";
    QRegularExpressionMatchIterator i = re.globalMatch(str);
    while (i.hasNext()) {
        QRegularExpressionMatch match = i.next();
        qDebug() << match.captured();
        match.capturedStart();
        match.capturedEnd();
    }
    return a.exec();
}
